package com.huwaiwai.jvm.demo03;

/**
 * Created by hww on 2018/11/21 11:32 PM.
 */
public class Test {

    public static void main(String [] args) {
        test2();
    }

    public static void test1() {
        Runtime runtime = Runtime.getRuntime();
        System.out.println(runtime.maxMemory());
        System.out.println(runtime.totalMemory());
        System.out.println(runtime.maxMemory() / runtime.totalMemory());
    }


    public static void test2() {
        String s = "";
        for (int i = 0; i < 10; i++) {
            s += i + s;
            s.intern();
        }
    }
}
